<template>
  <div>
    <div class="ad-container"></div>
    <!-- <image src="https://wx.qolayapp.cn/static/images/swiper/ad.jpg"></image> -->
    <web-view :src="adURL"></web-view>
  </div>
</template>
<script>
export default {
  data() {
    return {
      adURL: ""
    };
  },
  mounted() {
    /*  let { id } = this.$root.$mp.query;
    id = Number(id);
    let { adList } = wx.getStorageSync("config");
    this.adURL = adList[id].adURL; */
  },
  onLoad(e) {
    wx.setNavigationBarTitle({ title: "مارس ئېلانچىلىقى" });
    let { from, id } = e;
    // console.log(id, from);
    let config = wx.getStorageSync("config");
    if (from == "homePage") {
      this.adURL = config.adList.homePage[id].adUrl;
    }
    if (from == "hotVideo") {
      this.adURL = config.adList.hotVideo[id].adUrl;
    }
    if (from == "newVideo") {
      this.adURL = config.adList.newPage[id].adUrl;
    }
    if (from == "videoPage") {
      this.adURL = config.adList.videoPage[id].adUrl;
    }
    if (from == "videoDetail") {
      this.adURL = config.adList.videoPage[id].adUrl;
    }
    console.log(this.adURL);
  }
};
</script>
<style lang="scss">
.ad-container {
  width: 100%;
  height: 300rpx;
}
</style>
